<html>
    <head>

    </head>
    <body>
        <script>
            var d1=new Date();
            var d2=new Date(d1.getFullYear()+1,0,1);
            var span=d2.getTime()-d1.getTime();
            var spanDay=span/1000/60/60/24;
            document.write("间隔"+spanDay+"天");

            var d3=new Date(2002,12,25);
            var span1=d1.getTime()-d3.getTime();
            var spanDay1=span1/1000/60/60/24;
            document.write("间隔"+spanDay1+"天");

        </script>
    </body>
</html>